@model ShivamEMR.Model.Domain.PatientDomain.Admission

@* This partial view defines form fields that will appear when creating and editing entities *@

<script type="text/javascript">
    $(document).ready(function () {

        $("#admissiontype").change(function () {
            var path = "/Admission/GetEmployeesToAssign/" + $(this).val();
            $.get(path, function (data) {
                $("#assignedData").hide("fast").html(data).show("slow");
            });
        });

    });

</script>


<div class="editor-label">
    @Html.LabelFor(model => model.AdmissionDateAndTime)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.AdmissionDateAndTime)
    @Html.ValidationMessageFor(model => model.AdmissionDateAndTime)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.ReferrerNotes)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.ReferrerNotes)
    @Html.ValidationMessageFor(model => model.ReferrerNotes)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.Notes)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Notes)
    @Html.ValidationMessageFor(model => model.Notes)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.DischargeDateAndTime)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.DischargeDateAndTime)
    @Html.ValidationMessageFor(model => model.DischargeDateAndTime)
</div>

<div class="editor-label">
    AdmissionType
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.AdmissionTypeID, ((IEnumerable<ShivamEMR.Model.Domain.PatientDomain.AdmissionType>)ViewBag.PossibleAdmissionTypes).Select(option => new SelectListItem {
        Text = Html.DisplayTextFor(_ => option.Type).ToString(), 
        Value = option.ID.ToString(),
        Selected = (Model != null) && (option.ID == Model.AdmissionTypeID)
}), "Choose...", new { @id = "admissiontype" })
    @Html.ValidationMessageFor(model => model.AdmissionTypeID)
</div>
@*<div class="editor-label">
    Patient
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.PatientID, ((IEnumerable<ShivamEMR.Model.Domain.PatientDomain.Patient>)ViewBag.PossiblePatients).Select(option => new SelectListItem {
        Text = (option == null ? "None" : option.Title), 
        Value = option.ID.ToString(),
        Selected = (Model != null) && (option.ID == Model.PatientID)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.PatientID)
</div>*@
<div class="editor-label">
    ReferredBy
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.ReferredByID, ((IEnumerable<ShivamEMR.Model.Domain.DoctorsDomain.Doctor>)ViewBag.PossibleReferredBies).Select(option => new SelectListItem {
        Text = (option == null ? "None" : option.FullName), 
        Value = option.ID.ToString(),
        Selected = (Model != null) && (option.ID == Model.ReferredByID)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.ReferredByID)
</div>
<div class="editor-label">
    AdmissionStatus
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.AdmissionStatusID, ((IEnumerable<ShivamEMR.Model.Domain.PatientDomain.AdmissionStatus>)ViewBag.PossibleAdmissionStatus).Select(option => new SelectListItem {
        Text = Html.DisplayTextFor(_ => option.Status).ToString(), 
        Value = option.ID.ToString(),
        Selected = (Model != null) && (option.ID == Model.AdmissionStatusID)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.AdmissionStatusID)
</div>


     <div class="editor-label">
            Assigned To
        </div>
        <div class="editor-field" id="assignedData">

        @Html.Raw(ViewBag.AssignedTo)

          @*  @Html.DropDownListFor(model => model.Assignments, ((IEnumerable<ShivamEMR.Model.Domain.CompanyDomain.Employee>)ViewBag.PossibleEmployees).Select(option => new SelectListItem
        {
            Text = (option == null ? "None" : option.FullName),
            Value = option.ID.ToString()/*,
            Selected = (Model != null) && (option.ID == Model.AssignedToID)*/
        }), "Choose...", new { @multiple = "multiple" })*@
                   @* @Html.ValidationMessageFor(model => model.AssignedToID)*@
     </div>

 